package
{
	import com.thaiflashdev.utils.*;

	import flash.display.Bitmap;
	import flash.display.Sprite;
	import flash.events.Event;

	/**
	 * LoaderUtil examples
	 * @author katopz@sleepydesign.com
	 */
	public class LoaderUtilTest extends Sprite
	{
		public function LoaderUtilTest()
		{
			// case #1
			LoaderUtil.load("test.jpg", eventHandler);

			// case #2
			//LoaderUtil.loadAsset("test.jpg", eventHandler);

			// case #3
			//LoaderUtil.loadBinary("test.jpg", trace);

			// case #4
			//addChild(LoaderUtil.load("test.jpg") as Loader);
		}

		private function eventHandler(event:Event):void
		{
			if (event.type == "complete")
				addChild(event.target["content"] as Bitmap);
		}
	}
}